package main

import (
	"encoding/json"
	"fmt"
	"github.com/vmihailenco/msgpack"
)
type Person struct{
	Age int
	Name string
}
func main(){
	p1:=Person{
		Name:"f2345",
		Age:25,
	}
	b,err:=msgpack.Marshal(p1)
	if err!=nil{

	}
	j,_:=json.Marshal(p1)
	fmt.Println("json:",len(j))
	fmt.Println("msgPack:",len(b))
	fmt.Printf("%s",b)
	p2:=new(Person)
	msgpack.Unmarshal(b,p2)
	fmt.Println(p2)
}
